<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
        <meta name="author" content="order by dede58.com"/>
		<title>我的购物车-小米商城</title>
		<link rel="stylesheet" type="text/css" href="./css/style.css">
		
		
			<!-- 	easyui -->
		<link rel="stylesheet" type="text/css" href="res/themes/default/easyui.css">
	<link rel="stylesheet" type="text/css" href="res/themes/icon.css">
	 
	<script type="text/javascript" src="res/jquery.min.js"></script>
	<script type="text/javascript" src="res/jquery.easyui.min.js"></script>
		
	</head>
	<body>
	<!-- start header -->
	<!--end header -->

<!-- start banner_x -->
		<div class="banner_x center">
			<a href="./index.html" target="_blank"><div class="logo fl"></div></a>
			
			<div class="wdgwc fl ml40">我的购物车</div>
			<div class="wxts fl ml20">温馨提示：产品是否购买成功，以最终下单为准哦，请尽快结算</div>
			<div class="dlzc fr">
				<ul>
					<li><a href="./login.html" target="_blank">登录</a></li>
					<li>|</li>
					<li><a href="./register.html" target="_blank">注册</a></li>	
				</ul>
				
			</div>
			<div class="clear"></div>
		</div>
		<div class="xiantiao"></div>
		<div class="gwcxqbj">
			<div class="gwcxd center">
				<div class="top2 center">
					<div class="sub_top fl">
						<input type="checkbox" value="quanxuan" class="quanxuan" />全选
					</div>
					<div class="sub_top fl">商品名称</div>
					<div class="sub_top fl">单价</div>
					<div class="sub_top fl">数量</div>
					<div class="sub_top fl">小计</div>
					<div class="sub_top fr">操作</div>
					<div class="clear"></div>
				</div>
					<div id="pp" class="easyui-pagination" data-options="total:1000,pageSize:10" style="background:#efefef;border:1px solid #ccc;"></div> 
				<div class="xianshidingdan" ></div>
				<!-- <div class="content2 center">
					<div class="sub_content fl ">
						<input type="checkbox" value="quanxuan" class="quanxuan" />
					</div>
					<div class="sub_content fl"><img src="./image/gwc_xiaomi6.jpg"></div>
					<div class="sub_content fl ft20">小米6全网通6GB内存+64GB 亮黑色</div>
					<div class="sub_content fl ">2499元</div>
					<div class="sub_content fl">
						<input class="shuliang" type="number" value="1" step="1" min="1" >
					</div>
					<div class="sub_content fl">2499元</div>
					<div class="sub_content fl"><a href="">×</a></div>
					<div class="clear"></div>
				</div> -->
				<!-- <div class="content2 center">
					<div class="sub_content fl ">
						<input type="checkbox" value="quanxuan" class="quanxuan" />
					</div>
					<div class="sub_content fl"><img src="./image/gwc_xiaomi6.jpg"></div>
					<div class="sub_content fl ft20">小米6全网通6GB内存+64GB 亮黑色</div>
					<div class="sub_content fl ">2499元</div>
					<div class="sub_content fl">
						<input class="shuliang" type="number" value="1" step="1" min="1" >
					</div>
					<div class="sub_content fl">2499元</div>
					<div class="sub_content fl"><a href="">×</a></div>
					<div class="clear"></div>
				</div>
			</div> -->
			<div class="jiesuandan mt20 center">
				<div class="tishi fl ml20">
					<ul>
						<li><a href="./liebiao.html">继续购物</a></li>
						<li>|</li>
						<li>共<span>2</span>件商品，已选择<span>1</span>件</li>
						<div class="clear"></div>
					</ul>
				</div>
				<div class="jiesuan fr">
					<div class="jiesuanjiage fl">合计（不含运费）：<span>0.00元</span></div>
					<div class="jsanniu fr"><input class="jsan" type="submit" name="jiesuan"  value="去结算"/></div>
					<div class="clear"></div>
				</div>
				<div class="clear"></div>
			</div>
			
		</div>

  

	
	<!-- footer -->
	<footer class="center">
			
			<div class="mt20">小米商城|MIUI|米聊|多看书城|小米路由器|视频电话|小米天猫店|小米淘宝直营店|小米网盟|小米移动|隐私政策|Select Region</div>
			<div>©mi.com 京ICP证110507号 京ICP备10046444号 京公网安备11010802020134号 京网文[2014]0059-0009号</div> 
			<div>违法和不良信息举报电话：185-0130-1238，本网站所列数据，除特殊说明，所有数据均出自我司实验室测试</div>
		</footer>
		<!-- //计算总价 -->
<input type="hidden" id="zongjia" >
	</body>
	
	<script type="text/javascript">
/* 表示是否全选 */
 var flag=false;
$("#pp").pagination({  
	total:'15',
	pageSize:3,
	pageList: [1,2,3,4],
    beforePageText: '第',//页数文本框前显示的汉字   
    afterPageText: '页    共 {pages} 页',  
    displayMsg: '第{from}到{to}条，共{total}条',  
}); 
 
	 
	
	$('#pp').pagination({
		onSelectPage:function(pageNumber, pageSize){
			$(this).pagination('loading');
			 
			alert('pageNumber:'+pageNumber+',pageSize:'+pageSize);
			pagin(pageNumber,pageSize);
			$(this).pagination('loaded');
		}
	});
	pagin(1,3);
	//这是分页ajax
	function pagin(pageNumber,pageSize){
		$.ajax({
			url:"findGouWu",
			data:{pageNumber:pageNumber,pageSize:pageSize},
			dataType:"json",
			success:function(suc){
				$(".content2").remove();
				for(var i in suc){
					$(".xianshidingdan").append(" <div class='content2 center'>"+
						"	<div class='sub_content fl'>"+
						"	<input type='checkbox' value='quanxuan' class='quanxuan' />"+
						"</div>"+
						"<div class='sub_content fl'><img src='./image/gwc_xiaomi6.jpg'></div>"+
						"<div class='sub_content fl ft20'>小米6全网通6GB内存+64GB 亮黑色</div>"+
						"<div class='sub_content fl'>2499元</div>"+
						"<div class='sub_content fl'>"+
						"	<input class='shuliang' type='number' value='1' step='1' min='1' >"+
						"</div>"+
						"<div class='sub_content fl money'>"+suc[i]['money']+"</div>"+
						"<div class='sub_content fl'><a href=''>×</a></div>"+
						"<div class='clear'></div>"+
					"</div>"+
				"</div>");
		
				}
				//点击一个取消，然后价格减一
				$(".sub_content.fl .quanxuan").each(
				function(i){
					$(this).click(
					function(){
					var a= $(this).sublings(".sub_content.fl.money").text();
					 alert(a)
					}		
					);
				}		
				);
				
				if(flag){
					$("input:checkbox").prop("checked", true);
				}
			}
		}		
		);
	}
	//全选操作01
		 $(".quanxuan").eq(0).click(
					function(){
						if(this.checked){
							flag=true;
							$("input:checkbox").prop("checked", true);
							//这是用户id
							allPrice(1);
						}else{
							flag=false;
							$("input:checkbox").prop("checked", false);
							$(".jiesuanjiage.fl span").text("0.00元");
						}
						
					
					}		 
					 );

	//发现全部的价格
	function allPrice(uid){
		
		 $.ajax(
				 {
				 	url:"findZongjia",
				 	data:"user.id="+1,
				 	dataType:"json",
				 	success:function(suc){
				 	$(".jiesuanjiage.fl span").text(suc+"0元");
				 	}
				 	}		 
				  );
				 	
		
		
	}
	
	</script>
</html>
